package com.amit.struts;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.DynaValidatorForm;

public class EmployeeAction extends JLCBaseAction {
	
	
	public ActionForward verifyEmployee(ActionMapping am,ActionForm af,HttpServletRequest req,HttpServletResponse res)throws
	Exception
	{
		
		DynaValidatorForm dvf=(DynaValidatorForm) af;
		
		String un=dvf.get("username").toString();
		String pw=dvf.get("password").toString();
		
		EmployeeTO eto=employeeService.verifyEmployee(un,pw);
		
		HttpSession session=req.getSession();
		session.setAttribute("ETO", eto);
		return am.findForward("Home");
		
	}

}
